package com.zc.study.designPattern.结构型设计模式.facadePattern;

import java.io.FileInputStream;

/**
 * 文件读取类:子系统类
 */
public class FileReader {
    public String read(String fileNameSrc){
        System.out.println("读取文件,获取明文:");
        StringBuffer sb = new StringBuffer();
        try {
            FileInputStream inFS = new FileInputStream(fileNameSrc);
            int data;
            while((data = inFS.read())!=-1){
                sb = sb.append((char)data);
            }
            inFS.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return sb.toString();
    }
}
